﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestGetAddressMapLoc.aspx.cs" Inherits="System.Web.Map.TestGetAddressMapLoc" %>

<%@ Import Namespace="System.Web.Map.Model" %>
<%@ Import Namespace="Newtonsoft.Json" %>
<%@ Import Namespace="System.Web.Map" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style>
        html, body, iframe {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            border: none;
            overflow: hidden;
        }
    </style>
</head>
    <!--[if lt IE 9]>
    <script src="/js/json2.min.js"></script>
    <![endif]-->
<body>
    <%
        var data = new GetAddressMapLocReqModel()
        {
            ReturnUrl = "callback",
            Address = "坂田",
            MapCity = "深圳",
            //Loc = new PointModel()
            //{
            //    lat = 114.067579,
            //    lng = 22.638999
            //}
        };
        reqParamData.Value = JsonConvert.SerializeObject(data);
    %>
    <iframe frameborder="0" name="frame" id="frame"></iframe>
    <form id="form1" runat="server" action="http://mapdev.lizhanglong.com/Map.aspx" target="frame">
        <asp:HiddenField runat="server" ID="reqParamData" />
        <input type="hidden" value="GetAddressMapLoc" name="method" />
    </form>
    <script>
        if (!/^[\d\.\:]+$/.test(location.host)) {
            document.domain = location.host.match(/(\w+\.\w+)(:|$)/)[1];
        }
        document.forms[0].submit();

        function callback(data) {
            alert(JSON.stringify(data));
        }
    </script>
</body>
</html>
